package a05_双指针法;

/**
 * <p>
 * a05_反转链表复习3
 * </p>
 *
 * @author flyduck
 * @since 2024/12/27
 */
public class a05_反转链表复习3 {
    public ListNode reverseList(ListNode head) {
        ListNode prevNode = null;
        ListNode curNode = head;
        while (curNode != null) {
            ListNode temp = curNode.next;

            curNode.next = prevNode;

            prevNode = curNode;
            curNode = temp;

        }
        return prevNode;
    }
}
